package com.dong.drool.autoconfigure.core;



import java.io.Serializable;
import java.util.Objects;

/**
 *  drool规则信息实体
 * @author zhaodongchao
 * @date 2019/2/25 18:08
 */
public class RuleEntity implements Serializable {

    private static final long serialVersionUID = -4224843315021163246L;

    /**
     * 主键ID
     */
    private String id;

    /**
     * 规则版本
     */
    private String ruleVersion;

    /**
     * 规则名称
     */
    private String ruleName;

    /**
     * 规则主体文本
     */
    private String content;

    /**
     * 创建时间
     */
    private String createTime;

    /**
     * 创建人 ID
     */
    private String createUser;
    /**
     * 修改时间
     */
    private String modifyTime;
    /**
     * 修改人 ID
     */
    private String modifyUser;

    public RuleEntity() {
    }

    public RuleEntity(String ruleVersion, String ruleName, String content) {
        this.ruleVersion = ruleVersion;
        this.ruleName = ruleName;
        this.content = content;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getRuleVersion() {
        return ruleVersion;
    }

    public void setRuleVersion(String ruleVersion) {
        this.ruleVersion = ruleVersion;
    }

    public String getRuleName() {
        return ruleName;
    }

    public void setRuleName(String ruleName) {
        this.ruleName = ruleName;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public String getCreateUser() {
        return createUser;
    }

    public void setCreateUser(String createUser) {
        this.createUser = createUser;
    }

    public String getModifyTime() {
        return modifyTime;
    }

    public void setModifyTime(String modifyTime) {
        this.modifyTime = modifyTime;
    }

    public String getModifyUser() {
        return modifyUser;
    }

    public void setModifyUser(String modifyUser) {
        this.modifyUser = modifyUser;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o){
            return true;
        }
        if (o == null || getClass() != o.getClass()){
            return false;
        }
        RuleEntity that = (RuleEntity) o;
        return Objects.equals(id, that.id) &&
                Objects.equals(ruleVersion, that.ruleVersion) &&
                Objects.equals(ruleName, that.ruleName) &&
                Objects.equals(content, that.content) &&
                Objects.equals(createTime, that.createTime) &&
                Objects.equals(createUser, that.createUser) &&
                Objects.equals(modifyTime, that.modifyTime) &&
                Objects.equals(modifyUser, that.modifyUser);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, ruleVersion, ruleName, content, createTime, createUser, modifyTime, modifyUser);
    }

    @Override
    public String toString() {
        return "RuleEntity{" +
                "id='" + id + '\'' +
                ", ruleVersion='" + ruleVersion + '\'' +
                ", ruleName='" + ruleName + '\'' +
                ", content='" + content + '\'' +
                ", createTime='" + createTime + '\'' +
                ", createUser='" + createUser + '\'' +
                ", modifyTime='" + modifyTime + '\'' +
                ", modifyUser='" + modifyUser + '\'' +
                '}';
    }
}
